<template>
  <div v-if="isShow">
    <div @click="clickGoForm" class="c-ph24 c-hh88 c-lh88 c-flex-row c-aligni-center">
      <div class="c-w0 c-flex-grow1 c-fs22 c-fc-xblack">报名信息</div>
      <div class="c-fs20 c-fc-gray c-mr8">{{hasFormLog && enableEdit == 2?'点击修改':'填写报名信息'}}</div>
      <div class="iconfont c-fs14 c-fc-gray">&#xe60e;</div>
    </div>
  </div>
</template>
<script>
export default {
  name: "rewriteForm",
  components: {
  },
  props: {
    isRelForm: { //是否开启了表单
      type: Boolean,
      default: false,
    },
    hasFormLog: { //是否填写过表单
      type: Boolean,
      default: false,
    },
    collectPage: { //1购买前 2购买后 3 非强制
      type: Number,
      default: 1
    },
    enableEdit: { //1不支持修改 2 支持修改
      type: Number,
      default: 1
    },
  },
  computed: {
    isShow() {
      //未填写表单 && 非强制填写
      let show = !this.hasFormLog && this.collectPage == 3;
      //已填写表单 && 支持修改
      let isWrite = this.hasFormLog && this.enableEdit == 2;
      let res = this.isShowFormlg && this.isRelForm && (show || isWrite);
      return res;
    },
  },
  data() {
    return {
      isShowFormlg: localStorage.getItem("showForm") == 1 ? true : false,
    };
  },
  methods: {
    clickGoForm() {
      this.$emit('goForm');
    }
  },

}
</script>